# -*- coding: UTF-8 -*-
"""
Create by Louis on 2019/7/21-18:29
"""
from flask import Flask
def register_blueprints(app):
    #蓝图注册到app上，蓝图与app关联,调用注册蓝图对象的方法
    from app.Api.v1 import crate_blueprint_v1
    app.register_blueprint(crate_blueprint_v1(),url_prefix = "/v1")
    #普通蓝图注册
    # from app.Api.v1.book import book
    # from app.Api.v1.user import user
    # app.register_blueprint(book)
    # app.register_blueprint(user)
    pass


def create_app():
    app = Flask(__name__)
    app.config.from_object("app.config.settings")
    app.config.from_object("app.config.secure")
    register_blueprints(app)
    return app